home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume16 / ecu3 / part28 < prev    next >
Encoding:
Internet Message Format  |  1991-01-06  |  27.6 KB

  1. From: wht@n4hgf.uucp (Warren Tucker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v16i052:  ECU async comm package rev 3.0, Part28/35
  4. Message-ID: <1991Jan6.053921.28800@sparky.IMD.Sterling.COM>
  5. Date: 6 Jan 91 05:39:21 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 8f09a46a 82e03e13 a23f1b9e bd548500
  8.  
  9. Submitted-by: wht@n4hgf.uucp (Warren Tucker)
  10. Posting-number: Volume 16, Issue 52
  11. Archive-name: ecu3/part28
  12.  
  13. ---- Cut Here and feed the following to sh ----
  14. #!/bin/sh
  15. # This is part 28 of ecu3
  16. if touch 2>&1 | fgrep 'amc' > /dev/null
  17.  then TOUCH=touch
  18.  else TOUCH=true
  19. fi
  20. # ============= xsel386/select.txt ==============
  21. if test ! -d 'xsel386'; then
  22.     echo 'x - creating directory xsel386'
  23.     mkdir 'xsel386'
  24. fi
  25. echo 'x - extracting xsel386/select.txt (Text)'
  26. sed 's/^X//' << 'SHAR_EOF' > 'xsel386/select.txt' &&
  27. XNOTE from ...!gatech!emory!tridom!wht:
  28. Xthe following is the mail message I originally received; with
  29. Xa little tinkering, i got the select call to behave as advertised
  30. Xin the BSD manual (my xenix is 386 2.3).  Added it to /lib/386/Slibx.a
  31. Xand all is well for me.  Good luck.
  32. X
  33. X
  34. XFrom emory!gatech!hubcap!ncrcae!ncr-sd!crash!elgar!ag Thu Feb  2 13:04:07 EST 1989
  35. XArticle 4851 of comp.unix.xenix:
  36. XPath: tridom!emory!gatech!hubcap!ncrcae!ncr-sd!crash!elgar!ag
  37. X>From: ag@elgar.UUCP (Keith Gabryelski)
  38. XNewsgroups: comp.unix.xenix
  39. XSubject: select() on SCO XENIX 2.3.
  40. XMessage-ID: <38@elgar.UUCP>
  41. XDate: 24 Jan 89 04:54:17 GMT
  42. XReply-To: ag@elgar.UUCP (Keith Gabryelski)
  43. XOrganization: Elgar Corporation, San Diego, CA
  44. XLines: 474
  45. X
  46. XA few days ago I was paging through my SCO XENIX 2.3.1 Release Notes
  47. Xand found, on page 44 (section 16), a section describing 4BSD
  48. Xenhancements to the current release of SCO XENIX.
  49. X
  50. Xselect(S) was mentioned specifically.
  51. X
  52. XI checked the rest of the 2.3 manuals to see if there was a clue on
  53. Xhow to access select(); no dice.  I tried my 2.2 dev sys libraries to
  54. Xsee if it had been supported in previous releases and just not
  55. Xmentioned; negative.
  56. X
  57. XI decided to see if I could get select() to work on my system.  And
  58. Xthat is what this article is about.
  59. X
  60. XI checked /xenix and found:
  61. X
  62. X    % nm xenix | grep select
  63. X    nm: xenix: too many symbols to sort        # chuckle
  64. X    0020:00015bec  T _select
  65. X
  66. XBingo!  I also found <sys/select.h> (which has a comment about
  67. Xthe select(2) system call. :-) ).
  68. X
  69. XWhen a system call is made in a C program on a Unix system (eg
  70. Xopen(2)), it actually links in a file from libc.a (/lib/libc.a) (in
  71. Xthis case `open.o') written in assembly that loads a register with a
  72. Xsystem call number and causes an exception to occur.  The `trap'
  73. Xinstruction is used on the 68000, on a vax it's `chmk', and on a 370
  74. Xit's `svc'.  Control is transfered to the kernel which (in the case of
  75. Xthis particular exception) will index the register into a table
  76. X(called the sysent table) to get the address of the actual routine in
  77. Xkernel memory to call (_open).
  78. X
  79. XAt least under SCO XENIX this algorithm is modified somewhat.
  80. X
  81. XWhen a system call is made in a C program on a SCO XENIX system (eg
  82. Xopen(S)), it links in a file from libc.a (/lib/386/Slibc.a) (in this
  83. Xcase `open.o') written in assembly that loads the register `eax' with
  84. Xa system call number and jumps to 7:0 which (a guess) is mapped to an
  85. Xinstruction that switches into supervisory mode and jumps to the
  86. Xroutine ioint (??) in the kernel address space.  The interrupt routine
  87. Xhands the system call number (along with the user given arguments) to
  88. X_trap with figures out what to sysent table to use (there are a few
  89. Xunder SCO XENIX) and does the right thing.
  90. X
  91. XThe _open routine (in libc.a's open.o) would probably look something
  92. Xlike:
  93. X
  94. X;
  95. X; open - open a file for reading or writing
  96. X;
  97. X
  98. X    title    open
  99. X
  100. X    .386
  101. X
  102. XSYSNUM    equ     5            ; open's system call number is `5'.
  103. Xextrn    _errno:dword
  104. X
  105. Xpublic  _open
  106. X
  107. X_TEXT    segment  dword use32 public 'CODE'
  108. X    assume   cs: _TEXT
  109. X_open    proc near
  110. X    mov    eax, SYSNUM        ; Get system call number.
  111. X
  112. X    ;
  113. X    ; I don't even pretend to understand masm syntax.  I tried
  114. X    ; the following line (and variations) without any success.
  115. X    ;
  116. X
  117. X;    call    far 7:0            ; Switch to kernel and call SYSNUM.
  118. X
  119. X    ;
  120. X    ; Don't laugh, it works.
  121. X    ;
  122. X
  123. X    db 9ah
  124. X    dw 0,0
  125. X    dw 7
  126. X
  127. X    jb    short _cerror        ; below == error.
  128. X
  129. X    xor    eax, eax        ; zero return value (no error).
  130. X    ret                ; done.
  131. X
  132. X_cerror:
  133. X    mov    _errno, eax        ; Save error code in _errno.
  134. X    mov    eax, -1            ; Return -1 (as error).
  135. X    ret                ; done.
  136. X
  137. X_open    endp
  138. X
  139. X_TEXT    ends
  140. X
  141. X    end
  142. X
  143. XUnder SCO XENIX the sysent table (struct sysent in <sys/systm.h>) looks
  144. Xsomething like:
  145. X
  146. Xstruct sysent
  147. X{
  148. X    unsigned char  sy_ret;     /* Type of return value (int, void ...) */
  149. X    unsigned char  sy_arg386;     /* Number of 386 words args on stack */
  150. X    unsigned char  sy_nlarg286;     /* # of 286 large model word args on stack */
  151. X    unsigned char  sy_nmarg286;     /* 286 Small Middle: max # of args */
  152. X    unsigned       sy_argmask;     /* Argument types on stack. */
  153. X         int   (*sy_call)(); /* System call address in kernel */
  154. X}
  155. X
  156. Xsy_ret is the type return of the value this system call returns.  `0'
  157. Xseems to be INT and `6' is probably void.
  158. X
  159. Xsy_arg386 is the number of words the arguments for this system call
  160. Xtake on the stack.
  161. X
  162. Xsy_nlarg286 and sy_nmarg286 are similar to sy_arg386 but used for
  163. Xdoing 286 stuff.  I don't plan on mentioning the 286 stuff in this
  164. Xarticle that much, it just isn't interesting to me.
  165. X
  166. Xsy_argmask is the type of args on the stack using the following table:
  167. X
  168. XNUM | SYMBOL  | 386 | 286L | EXPLANATION
  169. X 0  |         |     |      | Arg not used.
  170. X 1  | DATAP   |     2  |  1   | Arg is a data pointer; seg + address
  171. X 2  | TEXTP   |     2  |  1   | Arg is a text pointer; seg + address
  172. X 3  | CONST   |     1  |  1   | Arg is an int-sized constant 
  173. X 4  | UCONST  |     1  |  1   | Arg is an unsigned int-sized constant
  174. X 5  | LCONST  |  1  |  1   | Arg is a long-sized constant
  175. X 6  | FDATAP  |     1  |  1   | Arg is FAR data pointer.
  176. X 7  | SODATAP |  2  |      | 386: 32-bit offset.
  177. X    |         |     |  1   | 286: low word is 16 bit data pointer offset,
  178. X    |         |        |      |      high word is 16 bit selector.
  179. X 8  | SOTEXTP |  2  |      | 386: 32-bit offset.
  180. X    |         |     |  1   | 286: low word is 16 bit text pointer offset,
  181. X    |         |        |      |      high word is 16 bit selector.
  182. X
  183. XEach nybble in sy_argmask represents one argument passed to the system
  184. Xcall.  Bits 0-3 represent arg one; 4-7 arg two; 8-12 arg three; etc.
  185. XA total of eight arguments (4 bits times 8 args = 32 bits in an int)
  186. Xcan be passed to a function (although MASK, a macro used to make
  187. Xsysent's sy_argmask field is limited to six arguments).
  188. X
  189. XNUM is the number (put in each nybble) represented by the SYMBOL (in
  190. X<sys/systm.h>) that corresponds to the arg type EXPLANATION and takes
  191. X[386|286] (depending on the model you are using) words on the user
  192. Xstack.
  193. X
  194. XSo, for the open() system call: sy_argmask is 0x00000331 and sy_arg386
  195. Xis 0x04.
  196. X
  197. X    open(char *path, int oflag, int mode);
  198. X             ^^^^^^      ^^^        ^^^
  199. X             DATAP       CONST      CONST
  200. X
  201. Xsy_call is the pointer to the function in kernel memory that should
  202. Xhandle this system call request.
  203. X
  204. XThe sysent table on my system looks something like:
  205. X
  206. XSyscal Num | ret| 386| L  | SM |    Arg Types    | System Call 
  207. Xsysent:
  208. X    00     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _nosys
  209. X    01     | 00 | 02 | 01 | 05 | 0 0 0 0 0 0 0 1 | _rexit
  210. X    02     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _fork    
  211. X    03     | 00 | 04 | 03 | 03 | 0 0 0 0 0 4 1 3 | _read    
  212. X    04     | 00 | 04 | 03 | 03 | 0 0 0 0 0 4 1 3 | _write
  213. X    05     | 00 | 04 | 03 | 03 | 0 0 0 0 0 3 3 1 | _open    
  214. X    06     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _close
  215. X    07     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _wait    
  216. X    08     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 1 | _creat    
  217. X    09     | 00 | 04 | 02 | 03 | 0 0 0 0 0 0 1 1 | _link    
  218. X    0a     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _unlink    
  219. X    0b     | 00 | 04 | 02 | 03 | 0 0 0 0 0 0 1 1 | _exec
  220. X    0c     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _chdir    
  221. X    0d     | 00 | 00 | 00 | 05 | 0 0 0 0 0 0 0 0 | _gtime
  222. X    0e     | 00 | 04 | 03 | 03 | 0 0 0 0 0 3 3 1 | _mknod       
  223. X    0f     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 1 | _chmod       
  224. X    10     | 00 | 04 | 03 | 03 | 0 0 0 0 0 3 3 1 | _chown       
  225. X    11     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 7 | _brk
  226. X    12     | 00 | 04 | 02 | 03 | 0 0 0 0 0 0 1 1 | _stat
  227. X    13     | 00 | 04 | 03 | 05 | 0 0 0 0 0 3 5 3 | _seek 
  228. X    14     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _getpid      
  229. X    15     | 00 | 05 | 03 | 03 | 0 0 0 0 0 3 1 1 | _smount      
  230. X    16     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _sumount     
  231. X    17     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 4 | _setuid      
  232. X    18     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _getuid      
  233. X    19     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 5 | _stime       
  234. X    1a     | 00 | 05 | 04 | 03 | 0 0 0 0 3 1 3 3 | _ptrace      
  235. X    1b     | 00 | 01 | 01 | 04 | 0 0 0 0 0 0 0 3 | _alarm       
  236. X    1c     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 1 3 | _fstat       
  237. X    1d     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _pause       
  238. X    1e     | 00 | 04 | 02 | 03 | 0 0 0 0 0 0 1 1 | _utime       
  239. X    1f     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 1 3 | _stty        
  240. X    20     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 1 3 | _gtty        
  241. X    21     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 1 | _saccess     
  242. X    22     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _nice        
  243. X    23     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 |
  244. X    24     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _sync        
  245. X    25     | 00 | 02 | 02 | 03 | 0 0 0 0 0 0 3 3 | _kill        
  246. X    26     | 00 | 00 | 01 | 00 | 0 0 0 0 0 0 0 0 |              
  247. X    27     | 00 | 00 | 02 | 00 | 0 0 0 0 0 0 0 0 |              
  248. X    28     | 00 | 00 | 03 | 00 | 0 0 0 0 0 0 0 0 |              
  249. X    29     | 00 | 02 | 02 | 03 | 0 0 0 0 0 0 3 3 | _dup         
  250. X    2a     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _pipe        
  251. X    2b     | 00 | 02 | 01 | 05 | 0 0 0 0 0 0 0 1 | _times       
  252. X    2c     | 06 | 08 | 05 | 03 | 0 0 0 1 4 8 4 1 | _profil      
  253. X    2d     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _lock        
  254. X    2e     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 4 | _setgid      
  255. X    2f     | 00 | 00 | 00 | 03 | 0 0 0 0 0 0 0 0 | _getgid      
  256. X    30     | 00 | 03 | 02 | 02 | 0 0 0 0 0 0 2 3 | _ssig        
  257. X    31     | 00 | 00 | 01 | 03 | 0 0 0 0 0 0 0 3 | _msgsys      
  258. X    32     | 06 | 07 | 04 | 03 | 0 0 0 0 5 5 1 3 | _sysi86      
  259. X    33     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _sysacct     
  260. X    34     | 00 | 00 | 01 | 06 | 0 0 0 0 0 0 0 3 | _shmsys      
  261. X    35     | 00 | 00 | 01 | 03 | 0 0 0 0 0 0 0 3 | _semsys      
  262. X    36     | 00 | 04 | 03 | 03 | 0 0 0 0 0 7 3 3 | _ioctl       
  263. X    37     | 00 | 00 | 04 | 00 | 0 0 0 0 0 0 0 0 |              
  264. X    38     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  265. X    39     | 00 | 00 | 05 | 00 | 0 0 0 0 0 0 0 0 |              
  266. X    3a     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  267. X    3b     | 00 | 06 | 03 | 03 | 0 0 0 0 0 1 1 1 | _exece       
  268. X    3c     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _umask       
  269. X    3d     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _chroot      
  270. X    3e     | 00 | 00 | 06 | 00 | 0 0 0 0 0 0 0 0 |              
  271. X    3f     | 00 | 00 | 07 | 00 | 0 0 0 0 0 0 0 0 |              
  272. X    40     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  273. X    41     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  274. X    42     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  275. X    43     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  276. X    44     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  277. X    45     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  278. X    46     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  279. X    47     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  280. X    48     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  281. X    49     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  282. X    4a     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  283. X    4b     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  284. X    4c     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  285. X    4d     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  286. X    4e     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  287. X    4f     | 00 | 00 | 08 | 00 | 0 0 0 0 0 0 0 0 |              
  288. X    50     | 00 | 00 | 09 | 00 | 0 0 0 0 0 0 0 0 |              
  289. X    51     | 00 | 04 | 03 | 03 | 0 0 0 0 0 4 1 3 | _getdents    
  290. X    52     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  291. X    53     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  292. X    54     | 00 | 00 | 0a | 00 | 0 0 0 0 0 0 0 0 |              
  293. X    55     | 00 | 06 | 04 | 03 | 0 0 0 0 3 1 1 3 | _getmsg      
  294. X    56     | 00 | 06 | 04 | 03 | 0 0 0 0 3 1 1 3 | _putmsg      
  295. X    57     | 00 | 05 | 03 | 03 | 0 0 0 0 0 3 5 1 | _poll        
  296. X    58     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  297. X    59     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  298. X    5a     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  299. X    5b     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  300. X    5c     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  301. X    5d     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  302. X    5e     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  303. X    5f     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  304. X    60     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  305. X    61     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  306. X    62     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  307. X    63     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys       
  308. X    64     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys
  309. X    65     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  310. X    66     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  311. X    67     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  312. X    68     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  313. X    69     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  314. X    6a     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  315. X    6b     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  316. X    6c     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  317. X    6d     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  318. X    6e     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  319. X    6f     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  320. X    70     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  321. X    71     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  322. X    72     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  323. X    73     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  324. X    74     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  325. X    75     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  326. X    76     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  327. X    77     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  328. X    78     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  329. X    79     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  330. X    7a     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  331. X    7b     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  332. X    7c     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  333. X    7d     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  334. X    7e     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys      
  335. X    7f     | 00 | 05 | 05 | 0a | 0 0 0 0 0 0 0 0 | _clocal     
  336. X
  337. X_v7sysent:
  338. X
  339. X    00     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 |
  340. X    01     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _ftime   
  341. X    02     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  342. X    03     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nullsys 
  343. X    04     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  344. X    05     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  345. X    06     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  346. X    07     | 00 | 05 | 05 | 0a | 0 0 0 0 0 0 0 0 | _clocal  
  347. X    08     | 00 | 00 | 00 | 08 | 0 0 0 0 0 0 0 0 | _cxenix  
  348. X    09     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  349. X    0a     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  350. X    0b     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  351. X    
  352. X_s3sysent:
  353. X    01     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 |
  354. X    02     | 00 | 06 | 04 | 03 | 0 0 0 0 3 3 1 1 | _statfs   
  355. X    03     | 00 | 05 | 04 | 03 | 0 0 0 0 3 3 1 3 | _fstatfs  
  356. X    04     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _setpgrp  
  357. X    05     | 00 | 00 | 00 | 08 | 0 0 0 0 0 0 0 0 | _cxenix   
  358. X    06     | 00 | 04 | 03 | 03 | 0 0 0 0 0 1 3 3 | _uadmin   
  359. X    07     | 00 | 00 | 00 | 09 | 0 0 0 0 0 0 0 0 | _utssys   
  360. X    08     | 00 | 03 | 03 | 03 | 0 0 0 0 0 3 3 3 | _fcntl    
  361. X    09     | 00 | 03 | 02 | 05 | 0 0 0 0 0 0 5 3 | _ulimit   
  362. X    0a     | 00 | 00 | 01 | 03 | 0 0 0 0 0 0 0 1 | _rmdir    
  363. X    0b     | 00 | 00 | 02 | 03 | 0 0 0 0 0 0 3 1 | _mkdir    
  364. X    0c     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys    
  365. X    
  366. X_svidsysent:
  367. X
  368. X    01     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 |
  369. X    02     | 00 | 06 | 04 | 03 | 0 0 0 0 3 3 1 1 | _statfs  
  370. X    03     | 00 | 05 | 04 | 03 | 0 0 0 0 3 3 1 3 | _fstatfs 
  371. X    04     | 00 | 00 | 01 | 03 | 0 0 0 0 0 0 0 3 | _setpgrp 
  372. X    05     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys   
  373. X    06     | 00 | 00 | 03 | 03 | 0 0 0 0 0 1 3 3 | _uadmin  
  374. X    07     | 00 | 00 | 00 | 09 | 0 0 0 0 0 0 0 0 | _utssys  
  375. X    08     | 00 | 00 | 03 | 03 | 0 0 0 0 0 3 3 3 | _fcntl   
  376. X    09     | 00 | 00 | 02 | 05 | 0 0 0 0 0 0 5 3 | _ulimit  
  377. X    0a     | 00 | 00 | 01 | 03 | 0 0 0 0 0 0 0 1 | _rmdir   
  378. X    0b     | 00 | 00 | 02 | 03 | 0 0 0 0 0 0 3 1 | _mkdir   
  379. X    0c     | 00 | 00 | 03 | 03 | 0 0 0 0 0 0 0 0 | _nosys   
  380. X
  381. X_clentry: used for oem CLOCAL routines.  Empty on my system.
  382. X
  383. X_cxentry: used for SCO added stuff.
  384. X
  385. X    00     | 00 | 05 | 03 | 03 | 0 0 0 0 0 4 7 1 | _shutdown
  386. X    01     | 00 | 04 | 03 | 03 | 0 0 0 0 0 7 3 3 | _locking
  387. X    02     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 1 | _creatsem
  388. X    03     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _opensem
  389. X    04     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _sigsem
  390. X    05     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _waitsem
  391. X    06     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _nbwaitsem
  392. X    07     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 3 | _rdchk
  393. X    08     | 00 | 01 | 01 | 03 | 0 0 0 0 0 0 0 4 | _stkgrow
  394. X    09     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys
  395. X    0a     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 5 3 | _chsize
  396. X    0b     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 1 | _ftime
  397. X    0c     | 00 | 02 | 01 | 05 | 0 0 0 0 0 0 0 5 | _nap
  398. X    0d     | 00 | 05 | 04 | 01 | 0 0 0 0 3 4 3 1 | _sdget
  399. X    0e     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 7 | _sdfree
  400. X    0f     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 7 | _sdenter
  401. X    10     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 7 | _sdleave
  402. X    11     | 00 | 02 | 01 | 03 | 0 0 0 0 0 0 0 7 | _sdgetv
  403. X    12     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 7 | _sdwaitv
  404. X    13     | 00 | 05 | 03 | 01 | 0 0 0 0 0 7 5 3 | _brkctl
  405. X    14     | 00 | 00 | 00 | 00 | 0 0 0 0 0 0 0 0 | _nosys
  406. X    15     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 1 3 | _nfs_sys
  407. X    16     | 00 | 04 | 03 | 03 | 0 0 0 0 0 1 3 3 | _msgctl
  408. X    17     | 00 | 03 | 02 | 03 | 0 0 0 0 0 0 3 5 | _msgget
  409. X    18     | 00 | 05 | 04 | 03 | 0 0 0 0 3 3 1 3 | _msgsnd
  410. X    19     | 06 | 07 | 05 | 03 | 0 0 0 3 5 3 1 3 | _msgrcv
  411. X    1a     | 00 | 05 | 04 | 03 | 0 0 0 0 7 3 4 3 | _semctl
  412. X    1b     | 00 | 04 | 03 | 03 | 0 0 0 0 0 3 3 5 | _semget
  413. X    1c     | 00 | 04 | 03 | 03 | 0 0 0 0 0 4 1 3 | _semop
  414. X    1d     | 00 | 04 | 03 | 03 | 0 0 0 0 0 1 3 3 | _shmctl
  415. X    1e     | 00 | 04 | 03 | 03 | 0 0 0 0 0 3 4 5 | _shmget
  416. X    1f     | 00 | 04 | 03 | 06 | 0 0 0 0 0 3 7 3 | _shmat
  417. X    20     | 00 | 04 | 03 | 03 | 0 0 0 0 0 1 3 3 | _proctl
  418. X    21     | 00 | 03 | 00 | 06 | 0 0 0 0 0 0 3 7 | _execseg
  419. X    22     | 00 | 02 | 00 | 03 | 0 0 0 0 0 0 0 7 | _unexecseg
  420. X    23     | 00 | 00 | 03 | 03 | 0 0 0 0 0 5 5 1 | _swapon
  421. X    24     | 00 | 09 | 05 | 03 | 0 0 0 1 1 1 1 3 | _select
  422. X
  423. XI couldn't really figure out how uadmin() was accessed.  libc's
  424. Xuadmin.o links in a routine that calls system call 0x37.  Hmmm...
  425. X
  426. XThe _cxentry is accessed by (documented in the programmer's reference
  427. Xunder System Calls) setting a bit in the system call number.  It seems
  428. Xas though it actually shifts the system call number up half a word and
  429. Xputs 0x28 in the low order halfword.
  430. X
  431. XNow we see that select() exists as a cxenix function (number 0x24),
  432. X
  433. XThere is also poll(), putmsg(), and getmsg() -- streams stuff.
  434. XSince the tty device is not a streams device (actually it looks as if
  435. Xthe streams stuff has been nulled out -- look at the master file for
  436. Xmore information) it is highly unlikely that these routines will do
  437. Xanything useful.  Infact, they don't.  Change the SYSNUM (and symbols)
  438. Xin the example open.s above to their appropriate values to try out the
  439. Xstreams routines.
  440. X
  441. Xselect.s looks something like:
  442. X
  443. X; select
  444. X;
  445. X;
  446. X;
  447. X
  448. X    title    select
  449. X
  450. X    .386
  451. X
  452. XSYSNUM    equ     2428h
  453. X
  454. Xextrn    _errno:dword
  455. X
  456. Xpublic  _select
  457. X
  458. X_TEXT    segment  dword use32 public 'CODE'
  459. X    assume   cs: _TEXT
  460. X_select    proc near
  461. X    mov    eax, SYSNUM        ; Get system call number.
  462. X
  463. X    ;
  464. X    ; I don't even pretend to understand masm syntax.  I tried
  465. X    ; the following line (and variations) without any success.
  466. X    ;
  467. X
  468. X;    call    far 7:0            ; Switch to kernel and call SYSNUM.
  469. X
  470. X    ;
  471. X    ; Don't laugh, it works.
  472. X    ;
  473. X
  474. X    db 9ah
  475. X    dw 0,0
  476. X    dw 7
  477. X
  478. X    jb    short _cerror        ; below == error.
  479. X
  480. X    xor    eax, eax        ; zero return value (no error).
  481. X    ret                ; done.
  482. X
  483. X_cerror:
  484. X    mov    _errno, eax        ; Save error code in _errno.
  485. X    mov    eax, -1            ; Return -1 (as error).
  486. X    ret                ; done.
  487. X
  488. X_select    endp
  489. X
  490. X_TEXT    ends
  491. X
  492. X    end
  493. X
  494. XThere is a header file you'll need in <sys/select.h> which has some
  495. Xinformation in it.
  496. X
  497. XA Synopsis of the SCO XENIX implementation:
  498. X
  499. X    #include <sys/select.h>
  500. X
  501. X    nfds = select(width readfds, writefds, exceptfds, timeout)
  502. X    int width, *readfds, *writefds, *exceptfds;
  503. X    struct timeval *timeout;  /* timeval is a pointer to a structure */
  504. X
  505. XI tested select() and found it to be half way implemented.  It seems
  506. Xas if there must be some extra field in struct cdevsw <sys/conf.h>.
  507. X
  508. XSo, I guess I wait 'til 3.2.
  509. X
  510. XPax, Keith
  511. X
  512. XPs, FYI.
  513. X
  514. XPps, if I made a mistake in my description of system call handling on
  515. XSCO XENIX or what not, please correct me.
  516. X
  517. XPpps, `call far 7:0' seems really reasonable to me.
  518. X-- 
  519. Xag@elgar.CTS.COM         Keith Gabryelski          ...!{ucsd, crash}!elgar!ag
  520. X
  521. X
  522. SHAR_EOF
  523. $TOUCH -am 0925141489 'xsel386/select.txt' &&
  524. chmod 0644 xsel386/select.txt ||
  525. echo 'restore of xsel386/select.txt failed'
  526. Wc_c="`wc -c < 'xsel386/select.txt'`"
  527. test 21402 -eq "$Wc_c" ||
  528.     echo 'xsel386/select.txt: original size 21402, current size' "$Wc_c"
  529. # ============= xsel386/ttiocom.c ==============
  530. echo 'x - extracting xsel386/ttiocom.c (Text)'
  531. sed 's/^X//' << 'SHAR_EOF' > 'xsel386/ttiocom.c' &&
  532. X
  533. X#include <sys/types.h>
  534. X#include <sys/tty.h>
  535. X#include <sys/select.h>
  536. X
  537. Xttiocom(ttyp, com, arg, flag)
  538. Xstruct tty *ttyp;
  539. Xint com, arg, flag;     /* there should be better types for this :-) */
  540. X{
  541. X        if (com == IOC_SELECT)
  542. X        {
  543. X                ttselect(ttyp, flag);
  544. X                return(0);      /*** THIS IS IMPORTANT ***/
  545. X        }
  546. X        return(Ttiocom(ttyp, com ,arg, flag));
  547. X}
  548. X
  549. SHAR_EOF
  550. $TOUCH -am 0814204290 'xsel386/ttiocom.c' &&
  551. chmod 0644 xsel386/ttiocom.c ||
  552. echo 'restore of xsel386/ttiocom.c failed'
  553. Wc_c="`wc -c < 'xsel386/ttiocom.c'`"
  554. test 391 -eq "$Wc_c" ||
  555.     echo 'xsel386/ttiocom.c: original size 391, current size' "$Wc_c"
  556. # ============= shar.fls ==============
  557. echo 'x - extracting shar.fls (Text)'
  558. sed 's/^X//' << 'SHAR_EOF' > 'shar.fls' &&
  559. XMake.ecu
  560. XREADME
  561. Xafterlint.c
  562. Xbamboozle.c
  563. Xbperr/bperr.c
  564. Xckermit/ckutio-orig.c
  565. Xckermit/ckutio.c
  566. Xckermit/ckutio.diff
  567. Xcmdtbl.c
  568. Xdialer.h
  569. Xdlent.h
  570. Xdoc/_basic.txt
  571. Xdoc/_end.txt
  572. Xdoc/_features.txt
  573. Xdoc/_hdb.txt
  574. Xdoc/_icmd.txt
  575. Xdoc/_intro.txt
  576. Xdoc/_p_cmd.txt
  577. Xdoc/_p_ifunc.txt
  578. Xdoc/_p_param.txt
  579. Xdoc/_p_sfunc.txt
  580. Xdoc/_proc.txt
  581. Xdoc/_startup.txt
  582. Xdoc/_tech.txt
  583. Xdoc/_top.txt
  584. Xdoc/ecu.txt
  585. Xdoc/runoff
  586. Xdvent.h
  587. Xecu.c
  588. Xecu.h
  589. XecuDCE.c
  590. XecuLCK.c
  591. Xecuchdir.c
  592. Xecucmd.h
  593. Xecudump.c
  594. Xecuerror.h
  595. Xecufinsert.c
  596. Xecufkey.c
  597. Xecufkey.h
  598. Xecufork.c
  599. Xecufork.h
  600. Xecufriend/Makefile
  601. Xecufriend/ecufriend.c
  602. Xecuhangup.h
  603. Xecuicmaux.c
  604. Xecuicmd.c
  605. Xecuicmhelp.c
  606. Xecuicmhist.c
  607. Xecukey.h
  608. Xeculine.c
  609. Xeculock.c
  610. Xecunumrev.c
  611. Xecupde.h
  612. Xecuphone.c
  613. Xecuphrase.c
  614. Xecurcvr.c
  615. Xecuscrdump.c
  616. Xecusetup.c
  617. Xecushm.c
  618. Xecushm.h
  619. Xecusighdl.c
  620. Xecutcap.c
  621. Xecutime.c
  622. Xecutty.c
  623. Xecutty.h
  624. Xecuuclc.c
  625. Xecuungetty.h
  626. Xecuungetty/Makefile
  627. Xecuungetty/ecuungetty.c
  628. Xecuusage.c
  629. Xecuutil.c
  630. Xecuvmin.h
  631. Xecuwinutil.c
  632. Xecuxenix.c
  633. Xecuxfer.c
  634. Xecuxkey.h
  635. Xesd.h
  636. Xesdutil.c
  637. Xexpresp.c
  638. Xfeval.c
  639. Xfeval.h
  640. Xgendial/Makefile
  641. Xgendial/dceMC9624.c
  642. Xgendial/dceT2500.c
  643. Xgendial/dceTBPlus.c
  644. Xgendial/dialer.h
  645. Xgendial/gendial.c
  646. Xgendial/template.c
  647. Xgint.c
  648. Xgstr.c
  649. Xhdbintf.c
  650. Xhelp/Makefile
  651. Xhelp/ecuhelp.src
  652. Xhelp/helpgen.c
  653. Xhelp/lint_args.h
  654. Xhelp/util.c
  655. Xlint_args.h
  656. Xlogevent.c
  657. Xmapkey/README
  658. Xmapkey/keys.usa.ecu.d
  659. Xmkoldproto.l
  660. Xmodels/bsd_uname.ep
  661. Xmodels/colors
  662. Xmodels/dir
  663. Xmodels/f.ep
  664. Xmodels/file_test.ep
  665. Xmodels/frame_test.ep
  666. Xmodels/gosub.ep
  667. Xmodels/goto_test.ep
  668. Xmodels/if_test.ep
  669. Xmodels/keys
  670. Xmodels/lookfortest.ep
  671. Xmodels/mhack_test.ep
  672. Xmodels/mkdir.ep
  673. Xmodels/oneline.ep
  674. Xmodels/opuslogin.ep
  675. Xmodels/p.ep
  676. Xmodels/phone
  677. Xmodels/phrases
  678. Xmodels/ps.ep
  679. Xmodels/put_ecu.ep
  680. Xmodels/root.ep
  681. Xmodels/rz_update.ep
  682. Xmodels/scm.ep
  683. Xmodels/senddate.ep
  684. Xmodels/sf_test.ep
  685. Xmodels/su.ep
  686. Xmodels/sysname.ep
  687. Xmodels/sz_update.ep
  688. Xmodels/szall.ep
  689. Xmodels/tty1a.mi
  690. Xmodels/tty2d.mi
  691. Xmodels/unixlogin.ep
  692. Xpatchlevel.h
  693. Xpc_scr.h
  694. Xpcmd.c
  695. Xpcmdfile.c
  696. Xpcmdif.c
  697. Xpcmdtty.c
  698. Xpcmdwhile.c
  699. Xpcmdxfer.c
  700. Xpoutput.c
  701. Xpprintf.c
  702. Xproc.c
  703. Xproc.h
  704. Xproc_error.c
  705. Xprocframe.c
  706. Xregexp.c
  707. Xrelop.h
  708. Xsea/Makefile
  709. Xsea/ecusea.c
  710. Xsea/ecusea.fls
  711. Xsea/lint_args.h
  712. Xsea/scurses.c
  713. Xsea/sealink.doc
  714. Xsea/sealink.imp
  715. Xshar.fls
  716. Xsmap.h
  717. Xstdio_lint.h
  718. Xsysdep.c
  719. Xutmpstat.c
  720. Xutmpstatus.h
  721. Xvar.c
  722. Xvar.h
  723. Xxsel386/fixttiocom.c
  724. Xxsel386/select-update
  725. Xxsel386/select.asm
  726. Xxsel386/select.txt
  727. Xxsel386/ttiocom.c
  728. Xz/Makefile
  729. Xz/comsrc.fls
  730. Xz/ecurz.c
  731. Xz/ecusz.c
  732. Xz/zcommon.c
  733. Xz/zcurses.c
  734. Xz/zdebug.c
  735. Xz/zlint.h
  736. Xz/zmodem.c
  737. Xz/zmodem.h
  738. Xzgcc
  739. SHAR_EOF
  740. $TOUCH -am 0815221090 'shar.fls' &&
  741. chmod 0644 shar.fls ||
  742. echo 'restore of shar.fls failed'
  743. Wc_c="`wc -c < 'shar.fls'`"
  744. test 2354 -eq "$Wc_c" ||
  745.     echo 'shar.fls: original size 2354, current size' "$Wc_c"
  746. # ============= sea/ecusea.fls ==============
  747. if test ! -d 'sea'; then
  748.     echo 'x - creating directory sea'
  749.     mkdir 'sea'
  750. fi
  751. echo 'x - extracting sea/ecusea.fls (Text)'
  752. sed 's/^X//' << 'SHAR_EOF' > 'sea/ecusea.fls' &&
  753. Xecusea.c
  754. Xscurses.c
  755. SHAR_EOF
  756. $TOUCH -am 0814210390 'sea/ecusea.fls' &&
  757. chmod 0644 sea/ecusea.fls ||
  758. echo 'restore of sea/ecusea.fls failed'
  759. Wc_c="`wc -c < 'sea/ecusea.fls'`"
  760. test 19 -eq "$Wc_c" ||
  761.     echo 'sea/ecusea.fls: original size 19, current size' "$Wc_c"
  762. # ============= z/comsrc.fls ==============
  763. if test ! -d 'z'; then
  764.     echo 'x - creating directory z'
  765.     mkdir 'z'
  766. fi
  767. echo 'x - extracting z/comsrc.fls (Text)'
  768. sed 's/^X//' << 'SHAR_EOF' > 'z/comsrc.fls' &&
  769. Xzcommon.c
  770. Xzcurses.c
  771. Xzdebug.c
  772. Xzmodem.c
  773. SHAR_EOF
  774. $TOUCH -am 0919194190 'z/comsrc.fls' &&
  775. chmod 0644 z/comsrc.fls ||
  776. echo 'restore of z/comsrc.fls failed'
  777. Wc_c="`wc -c < 'z/comsrc.fls'`"
  778. test 38 -eq "$Wc_c" ||
  779.     echo 'z/comsrc.fls: original size 38, current size' "$Wc_c"
  780. true || echo 'restore of ckermit/ckermit.01 failed'
  781. echo End of part 28, continue with part 29
  782. exit 0
  783. --------------------------------------------------------------------
  784. Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
  785. Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols
  786.  
  787. exit 0 # Just in case...
  788. -- 
  789. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  790. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  791. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  792. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  793.